package cate.game.role.bag;

import cate.common.table.item.IBagItemTpl;
import cate.common.util.GameResult;
import cate.game.client.msg.MergeMsgSender;
import cate.game.res.RewardShow;
import cate.game.role.bag.item.BaseBagItem;

import java.util.List;

public class BagContainerReference<B extends BagContainer<I>, I extends BaseBagItem> implements IBagContainer<I>{
    Class<B> bclazz;
    Class<I> iClass;
    MultiTypeBagProxy proxy;

    public BagContainerReference(Class<B> clazz, Class<I> iclass, MultiTypeBagProxy proxy) {
        this.bclazz = clazz;
        this.iClass = iclass;
        this.proxy = proxy;
    }

    @Override
    public I getItem(String uid) {
        return proxy.getItem(uid, bclazz, iClass);
    }

    @Override
    public List<I> getList() {
        return proxy.getList(bclazz, iClass);
    }

    @Override
    public String getUid() {
        return proxy.getUid();
    }

    @Override
    public String getBagName() {
        return proxy.getBagName();
    }

    @Override
    public long count(int tid) {
        return proxy.count(bclazz, tid);
    }

    @Override
    public GameResult<Void> addItem(I item, MergeMsgSender sender) {
        return proxy.addItem(bclazz, item, sender);
    }

    /** 添加 */
    @Override
    public GameResult<Void> addItem(int tid, long num, MergeMsgSender sender) {
        return proxy.addItem(bclazz, tid, num, sender);
    }

    /** 添加 */
    @Override
    public GameResult<Void> addItems(List<I> items, MergeMsgSender sender) {
        return proxy.addItems(bclazz, items, sender);
    }

    /** 移除背包中的指定物品 */
    @Override
    public GameResult<RewardShow> removeItem(String uid, MergeMsgSender sender) {
        return proxy.removeItem(bclazz, uid, sender);
    }

    /** 删除或扣除 */
    @Override
    public GameResult<RewardShow> removeItem(int tid, long num, MergeMsgSender sender) {
        return proxy.removeItem(bclazz, tid, num, sender);
    }

    /** 根据唯一id来删除 */
    @Override
    public GameResult<RewardShow> removeItemByUid(String uid, long num, MergeMsgSender sender) {
        return proxy.removeItemByUid(bclazz, uid, num, sender);
    }

    @Override
    public GameResult<Void> addItemCheck(int tid, long num) {
        return proxy.addItemCheck(bclazz, tid, num);
    }

    @Override
    public GameResult<RewardShow> notReallyRemove(String uid, MergeMsgSender sender) {
        return proxy.notReallyRemove(bclazz, uid, sender);
    }

    @Override
    public GameResult<RewardShow> notReallyRemove(int tid, long num, MergeMsgSender sender) {
        return proxy.notReallyRemove(bclazz, tid, num, sender);
    }

    @Override
    public GameResult<RewardShow> notReallyRemoveItemByUid(String uid, long num, MergeMsgSender sender) {
        return proxy.notReallyRemoveItemByUid(bclazz, uid, num, sender);
    }

    @Override
    public void forGmAddCapacity() {
        proxy.forGmAddCapacity(bclazz);
    }

    @Override
    public int gridEmpty() {
        return proxy.gridEmpty();
    }

    @Override
    public IBagItemTpl getItemTpl(int tid) {
        return proxy.getItemTpl(bclazz, tid);
    }
}
